import React from 'react'
import { getMenuSub } from 'services/utils'
import { Icon } from 'antd'
import AdminsGroup from './group'
import AdminsUser from './user'
import AdminsLogs from './log'
import Flag from 'config/flag'

const routes = {
  path: '/admins',
  name: '帐号管理',
  childRoutes: [
    //{ path: 'default', name: 'Home', component: Screen, isIndex: true },
    { 
      path: 'group', 
      name: '用户组设定', 
      component: AdminsGroup, 
      flags: Flag['/admins/group'],
      description: '系统用户组的设定'
    },
    { 
      path: 'user', 
      name: '用户管理', 
      component: AdminsUser, 
      flags: Flag['/admins/user'],
      description: '系统用户的管理；创建、修改、冻结、删除等等'
    },
    { 
      path: 'logs', 
      name: '日志管理', 
      component: AdminsLogs, 
      flags: Flag['/admins/logs'],
      description: '系统日志的查询'
    },
  ]
}

export default routes

export const menuSub = getMenuSub(routes, {
    key:   `admins`, 
    //name:  `帐号管理`, 
    icon:  <Icon type="solution" />
  })